<?php 
	 //Connects to your Database 
	 $db_host = 'localhost';
	 $db_user = 'function';
	 $db_pwd = 'w9ak4X1l0Y';

	 $database = 'function_a5110060';

	 $location_id = $_GET['id'];
	 $sub_location_ids = array();

	 $con = mysql_connect($db_host, $db_user, $db_pwd); 
	 mysql_select_db($database,$con) or die(mysql_error()); 
	
	 $data = mysql_query("SELECT sub_location_id,sub_location_name FROM Sub_Location_Master where master_location_id = ".$location_id)
	 or die(mysql_error()); 

	//echo $data;
	while($info = mysql_fetch_array( $data )) 
	 { 
		
		$row_array['optionValue'] = $info['sub_location_id'];
		$row_array['optionDisplay'] = $info['sub_location_name'];
		array_push($sub_location_ids,$row_array);

	 }
	echo json_encode($sub_location_ids);
?> 